﻿

function ajaxObject(param) {
    this.param = param;
    this.ajaxRequest = null;
    try {
        // Opera 8.0+, Firefox, Safari
        this.ajaxRequest = new XMLHttpRequest();
    } catch (e) {
        // Internet Explorer Browsers
        try {
            this.ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                this.ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {
                alert("Your browser does not support Ajax!");
                return false;
            }
        }
    }
    // use response to get the response text
    this.response = function () {
        if (this.ajaxRequest.readyState == 4) {
            //return this.ajaxRequest.responseText;
            if (this.ajaxRequest.status == 200) {
                return this.ajaxRequest.responseText;
            }
            else {
                return this.ajaxRequest.status;
            }
        }
    }
    this.ajaxRequest.onreadystatechange = function () { this.response };
    this.ajaxRequest.open('GET', this.param, false);
    this.ajaxRequest.send(null);
}